<?php
declare (strict_types = 1);

namespace app\admin\controller;

use think\facade\Request;
use think\facade\Db;
use think\facade\View;
class Attribute
{
    public function attribute()
    {

            // 接参
//            $prop_value = Request::get('prop_value/a',[],'trim,htmlspecialchars,strip_tags');
//            $keywords = Request::get('keywords','','trim,htmlspecialchars,strip_tags');
                $prop_value = Request::get('prop_value/a',[],'trim,htmlspecialchars,strip_tags');
                $pname = Request::get('pname','','trim,htmlspecialchars,strip_tags');

//            $data= Request::get('','','trim,htmlspecialchars,strip_tags');
                $data=[
                    'prop_value'=>$prop_value,
                    'pname'=>$pname,
                ];
            if(Cache::has('arr')){
                $arr=Cache::get('arr');
            }else{
                $arr=\app\admin\model\GoodsProp::getPropValue();
                Cache::set('arr',$arr,600);
            }
            View::assign('arr',$arr);

            $sx=\app\admin\model\GoodsProp::getGoodsProp($data,$data,[]);

            View::assign('data',$data);


            $empty = "<tr><td colspan='7'>暂无数据！</td></tr>";
            View::assign('empty',$empty);
            return View::fetch('goodspropvalue/goods_prop',['sx'=>$sx,'arr'=>$arr]);

        }

    }



//<?php
//declare (strict_types = 1);
//
//namespace app\index\controller;
//
//use app\index\model\GoodsProp;
//use think\facade\Cache;
//use think\facade\Db;
//use think\facade\Request;
//use think\facade\View;
//class GoodsPropValue
//{
//    //
//    public function goods_prop()
//    {
//
//        //$arr=\app\index\model\GoodsValueProp::getPropValue();
//
//////降维，展示复选框
////$value=Db::table("ecm_goods_prop_value")
////    ->field("vid,prop_value")
////    ->where("status",1)
////    ->select()
////    ->toArray();
////$arr = [];
////foreach($value as $v){
////    $arr[$v['vid']] = $v['prop_value'];
////
////}
//
//
//
//
//        //$data = Request::get('','','trim,htmlspecialchars,strip_tags');
//
//
//    }
//}
